<!DOCTYPE html>
<html class="x-admin-sm">

    <head>
        <meta charset="UTF-8">
        <title>设置矿名称</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!--        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />-->
        <link rel="stylesheet" href="./css/font.css">
        <link rel="stylesheet" href="./css/xadmin.css">
        <script src="./lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="./js/xadmin.js"></script>
        <script type="text/javascript" src="./js/jquery.min.js"></script>
        <script type="text/javascript" src="./data/sensor.js"></script>
        <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
        <style type="text/css">

        </style>

    </head>

    <body style="background-color: white;">
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body ">
                            煤矿名称：<input type="text" id="input_mine_name" style="width: 75%;" class="layui-text" placeholder="XX煤矿" onblur="saveMineName()">
                        </div>
                    </div>
                    <div class="layui-card">
                        <div class="layui-card-body ">
                            口号标题：<input type="text" id="input_slogan_title"  style="width: 75%;" class="layui-text" value="安全生产信息引导发布系统  干就干一流的事,干就干成一流"  onblur="saveSloganTitle()">
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </body>
    <script type="text/html" id="toolbarMenu">
        <div class = "layui-btn-container" >
            <!--            <button class = "layui-btn layui-btn-sm" lay-event = "getCheckData" > 获取选中行数据 </button>-->
            <!--            <button class="layui-btn layui-btn-sm" lay-event="getCheckLength">获取选中数目</button >-->
            <button class = "layui-btn layui-btn-sm" lay-event = "addSensor" onclick="xadmin.open('新增账号','./accountList-add.html',600,400)" > 新增账号</button>
<!--            <button class = "layui-btn layui-btn-danger" lay-event = "delCheckData" > <i class="layui-icon"></i>删除选中 </button>-->
        </div >
    </script>

    <script type="text/javascript">



        // $(function () {
        //     refData(1,10);
        // });
        function saveMineName(){
            let inputValue=$("#input_mine_name").val();
            if(inputValue=="")
                return;
            let postSData={"appkey":"mine_name","appval":inputValue,"note":"矿名称"};
            let result=sensorServer.updateSettingsInfo(postSData);
            if(result==1) {
                layer.msg("保存成功！");
                // layer.alert("修改成功", {
                //         icon: 6
                //     },
                //     function () {
                //         //关闭当前frame
                //         //xadmin.close();
                //
                //         // 可以对父窗口进行刷新
                //         xadmin.father_reload();
                //     });
            }else{
                layer.alert("修改失败", {
                        icon: 5
                    },
                    function () {
                        //关闭当前frame
                        //xadmin.close();

                        // 可以对父窗口进行刷新
                        //xadmin.father_reload();
                    });
            }
            // if(resultCount==1) {
            //     layer.msg("保存成功！");
            //
            // }else{
            //     layer.msg("保存失败！");
            // }
        }

        function saveSloganTitle(){
            let inputValue=$("#input_slogan_title").val();
            if(inputValue=="")
                return;
            let postSData={"appkey":"slogan_title","appval":inputValue,"note":"口号标题"};
            let result=sensorServer.updateSettingsInfo(postSData);
            if(result==1) {
                layer.msg("保存成功！");
                // layer.alert("修改成功", {
                //         icon: 6
                //     },
                //     function () {
                //         //关闭当前frame
                //         //xadmin.close();
                //
                //         // 可以对父窗口进行刷新
                //         xadmin.father_reload();
                //     });
            }else{
                layer.alert("修改失败", {
                        icon: 5
                    },
                    function () {
                        //关闭当前frame
                        //xadmin.close();

                        // 可以对父窗口进行刷新
                        //xadmin.father_reload();
                    });
            }
            // if(resultCount==1) {
            //     layer.msg("保存成功！");
            //
            // }else{
            //     layer.msg("保存失败！");
            // }
        }
    </script>


</html>
